package com.zh.core.common.bean;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @Description: 所有实体共同抽象类
 * @ClassName AbsBaseModel
 * @date: 2020.12.15 11:39
 * @Author: zhanghang
 */
@JsonIgnoreProperties(value = {"createBy", "createDate", "updateBy", "updateDate", "isDelete", "deleteDate"})
@Setter
@Getter
public abstract class AbsBaseModel {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", example = "0", dataType = "Long")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty(value = {"主键"}, index = 1)
    private Long id;

    /**
     * 新建人
     */
    @ApiModelProperty(value = "注册人", notes = "后台业务生成", hidden = true)
    @ExcelProperty(value = {"新建人"}, index = 9)
    private Long createBy;

    /**
     * 新建时间
     */
    @ApiModelProperty(value = "新建时间", notes = "后台业务生成", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty(value = {"新建时间"}, index = 10)
    private Date createDate;

    /**
     * 修改人
     */
    @ApiModelProperty(value = "注册人", notes = "后台业务生成", hidden = true)
    private Long updateBy;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间", notes = "后台业务生成", hidden = true)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateDate;

    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", notes = "后台业务生成", hidden = true)
    private Byte isDelete;

    /**
     * 删除时间
     */
    @ApiModelProperty(value = "删除时间", notes = "后台业务生成", hidden = true)
    private Date deleteDate;

    /**
     * pojo的基类对象构造函数
     */
    public AbsBaseModel() {}

}
